/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.util.ArrayList;

import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author Steffen
 */
@ManagedBean
@SessionScoped
public class Forum {
    
    private String theme;
    private int count;
    private ArrayList<Reply> replies = new ArrayList();
    
    public Forum(){
        count = 0;
    }
    
    public Forum(String s){
        this.theme = s;
        count = 0;
    }

    public void addReply(Reply reply){
        replies.add(new Reply(reply.getMessage()));
        count ++;
        reply.setMessage("");
    }
    
    
    /**
     * @return the theme
     */
    public String getTheme() {
        return theme;
    }

    /**
     * @param theme the theme to set
     */
    public void setTheme(String theme) {
        this.theme = theme;
    }

    /**
     * @return the count
     */
    public int getCount() {
        return count;
    }

    /**
     * @param count the count to set
     */
    public void setCount(int count) {
        this.count = count;
    }

    /**
     * @return the replies
     */
    public ArrayList<Reply> getReplies() {
        return replies;
    }
    
}
